<?php
// +----------------------------------------------------------------------
// |  [ MAKE YOUR WORK EASIER]
// +----------------------------------------------------------------------
// | Copyright (c) 2003-2016 http://www.nbcc.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: fangrenfu <fangrenfu@126.com>
// +----------------------------------------------------------------------

namespace app\admin\controller;

use app\common\access\MyAccess;
use app\common\access\MyController;
use app\common\service\Role;
//用户设置
class Set extends MyController
{


    /** 修改本人密码
     * @param string $oldpwd
     * @param string $newpwd
     * @return \think\response\Json
     */
    public function changepwd($oldpwd = '', $newpwd = '')
    {
        $result = null;
        try {
            $user = new \app\common\service\User();
            $result = $user->changeSelfPassword($oldpwd, $newpwd);

        } catch (\Exception $e) {
            MyAccess::throwException($e->getCode(), $e->getMessage());
        }
        return json($result);
    }

} 